import request from '@/utils/request'

// 查询流程实例列表
export function listBpmProcessInstance(query) {
  return request({
    url: '/flowable/bpmProcessInstance/list',
    method: 'get',
    params: query
  })
}

// 查询流程实例详细
export function getBpmProcessInstance(processInstanceId) {
  return request({
    url: '/flowable/bpmProcessInstance/' + processInstanceId,
    method: 'get'
  })
}

// 新增流程实例
export function addBpmProcessInstance(query) {
  return request({
    url: '/flowable/bpmProcessInstance/add',
    method: 'get',
    params: query
  })
}

// 修改流程实例
export function updateBpmProcessInstance(data) {
  return request({
    url: '/flowable/bpmProcessInstance',
    method: 'put',
    data: data
  })
}


// 删除流程实例
export function deleteHistoryProcessInstance(processInstanceId) {
  return request({
    url: '/flowable/bpmProcessInstance/deleteHistoryProcessInstance',
    method: 'get',
    params:{processInstanceId:processInstanceId}
  })
}

export function deleteProcessInstance(processInstanceId) {
  return request({
    url: '/flowable/bpmProcessInstance/deleteProcessInstance',
    method: 'get',
    params:{processInstanceId:processInstanceId}
  })
}


// 查询已完成流程实例列表
export function listFinishBpmProcessInstance(query) {
  return request({
    url: '/flowable/bpmProcessInstance/finishList',
    method: 'get',
    params: query
  })
}
